﻿using System;
using System.Collections;
using System.Collections.Generic;
using Huirui.Cavan.Domain.MainBoundedContext.SalesModule;
using Huirui.Cavan.Domain.MainBoundedContext.StockModule;
using Huirui.Cavan.Domain.MainBoundedContext.PurchaseModule;
using Huirui.Cavan.Domain.Seedwork;

namespace Huirui.Cavan.Domain.MainBoundedContext.SystemModule
{
    #region Corporation

    /// <summary>
    /// Corporation object for NHibernate mapped table 'Corporation'.
    /// </summary>
    [Serializable]
    public class Corporation : Persistent<string>
    {
        #region Member Variables
        protected string _name;
        protected IndustryType _industry;
        protected string _englishName;
        protected int _maxUser;
        protected string _contact;
        protected string _website;
        protected string _mobile;
        protected string _telephone;
        protected string _fax;
        protected string _email;
        protected Area _area;
        protected string _address;
        protected string _addressEnglish;
        protected string _deliveryAddress2;
        protected string _deliveryAddress3;
        protected string _deliveryAddress1;
        protected string _taxIdentificationNumber;
        protected string _bank;
        protected string _bankAccount;
        protected IList<BaseCodeRule> _baseCodeRules;
        protected IList<Department> _departments;
        protected IList<Employee> _employees;
        protected IList<Customer> _customers;
        protected IList<Supplier> _suppliers;
        protected IList<FeeType> _feeTypes;
        protected IList<Receivables> _receivableses;
        protected IList<Project> _projects;
        protected IList<Purchase> _purchases;
        protected IList<PurchaseOrder> _purchaseOrders;
        protected IList<Pay> _pays;
        protected IList<PurchaseReturn> _purchaseReturns;
        protected IList<Receipt> _receipts;
        protected IList<ReceiptCodeRule> _receiptCodeRules;
        protected IList<Sale> _sales;
        protected IList<SalesOrder> _salesOrders;
        protected IList<SalesReturn> _salesReturns;
        protected IList<Stock> _stocks;
        protected IList<StockAllocate> _stockAllocates;
        protected IList<StockExchange> _stockExchanges;
        protected IList<StockInOut> _stockIns;
        protected IList<StockInitialBalance> _stockInitialBalances;
        protected IList<WareHouse> _wareHouses;

        #endregion

        #region Constructors

        public Corporation() { }

        public Corporation(string code, string name, IndustryType industry, string englishName, int maxUser, string contact, string website, string mobile, string telephone, string fax, string email, Area area, string address, string addressEnglish, string deliveryAddress1, string deliveryAddress2, string deliveryAddress3, string taxIdentificationNumber, string bank, string bankAccount, DateTime createDate, DateTime modifyDate, int editUser)
        {
            this.Id = code;
            this._name = name;
            this._industry = industry;
            this._englishName = englishName;
            this._maxUser = maxUser;
            this._contact = contact;
            this._website = website;
            this._mobile = mobile;
            this._telephone = telephone;
            this._fax = fax;
            this._email = email;
            this._area = area;
            this._address = address;
            this._addressEnglish = addressEnglish;
            this._deliveryAddress2 = deliveryAddress2;
            this._deliveryAddress3 = deliveryAddress3;
            this._deliveryAddress1 = deliveryAddress1;
            this._taxIdentificationNumber = taxIdentificationNumber;
            this._bank = bank;
            this._bankAccount = bankAccount;
            this._createDate = createDate;
            this._modifyDate = modifyDate;
            this._editUser = editUser;
        }

        #endregion

        #region Public Properties

        public virtual string Name
        {
            get { return _name; }
            set
            {
                if (value != null && value.Length > 100)
                    throw new ArgumentOutOfRangeException("Invalid value for Name", value, value.ToString());
                _name = value;
            }
        }

        public virtual IndustryType Industry
        {
            get { return _industry; }
            set { _industry = value; }
        }

        public virtual string EnglishName
        {
            get { return _englishName; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Invalid value for EnglishName", value, value.ToString());
                _englishName = value;
            }
        }

        public virtual int MaxUser
        {
            get { return _maxUser; }
            set { _maxUser = value; }
        }

        public virtual string Contact
        {
            get { return _contact; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for Contact", value, value.ToString());
                _contact = value;
            }
        }

        public virtual string Website
        {
            get { return _website; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Invalid value for Website", value, value.ToString());
                _website = value;
            }
        }

        public virtual string Mobile
        {
            get { return _mobile; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for Mobile", value, value.ToString());
                _mobile = value;
            }
        }

        public virtual string Telephone
        {
            get { return _telephone; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for Telephone", value, value.ToString());
                _telephone = value;
            }
        }

        public virtual string Fax
        {
            get { return _fax; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for Fax", value, value.ToString());
                _fax = value;
            }
        }

        public virtual string Email
        {
            get { return _email; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Invalid value for Email", value, value.ToString());
                _email = value;
            }
        }

        public virtual Area Area
        {
            get { return _area; }
            set { _area = value; }
        }

        public virtual string Address
        {
            get { return _address; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Invalid value for Address", value, value.ToString());
                _address = value;
            }
        }

        public virtual string AddressEnglish
        {
            get { return _addressEnglish; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Invalid value for AddressEnglish", value, value.ToString());
                _addressEnglish = value;
            }
        }

        public virtual string DeliveryAddress2
        {
            get { return _deliveryAddress2; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Invalid value for DeliveryAddress2", value, value.ToString());
                _deliveryAddress2 = value;
            }
        }

        public virtual string DeliveryAddress3
        {
            get { return _deliveryAddress3; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Invalid value for DeliveryAddress3", value, value.ToString());
                _deliveryAddress3 = value;
            }
        }

        public virtual string DeliveryAddress1
        {
            get { return _deliveryAddress1; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Invalid value for DeliveryAddress1", value, value.ToString());
                _deliveryAddress1 = value;
            }
        }

        public virtual string TaxIdentificationNumber
        {
            get { return _taxIdentificationNumber; }
            set
            {
                if (value != null && value.Length > 100)
                    throw new ArgumentOutOfRangeException("Invalid value for TaxIdentificationNumber", value, value.ToString());
                _taxIdentificationNumber = value;
            }
        }

        public virtual string Bank
        {
            get { return _bank; }
            set
            {
                if (value != null && value.Length > 100)
                    throw new ArgumentOutOfRangeException("Invalid value for Bank", value, value.ToString());
                _bank = value;
            }
        }

        public virtual string BankAccount
        {
            get { return _bankAccount; }
            set
            {
                if (value != null && value.Length > 100)
                    throw new ArgumentOutOfRangeException("Invalid value for BankAccount", value, value.ToString());
                _bankAccount = value;
            }
        }

        public virtual IList<BaseCodeRule> BaseCodeRules
        {
            get
            {
                if (_baseCodeRules == null)
                {
                    _baseCodeRules = new List<BaseCodeRule>();
                }
                return _baseCodeRules;
            }
            set { _baseCodeRules = value; }
        }

        public virtual IList<Department> Departments
        {
            get
            {
                if (_departments == null)
                {
                    _departments = new List<Department>();
                }
                return _departments;
            }
            set { _departments = value; }
        }


        public virtual IList<Employee> Employees
        {
            get
            {
                if (_employees == null)
                {
                    _employees = new List<Employee>();
                }
                return _employees;
            }
            set { _employees = value; }
        }

        public virtual IList<Customer> Customers
        {
            get
            {
                if (_customers == null)
                {
                    _customers = new List<Customer>();
                }
                return _customers;
            }
            set { _customers = value; }
        }

        public virtual IList<Supplier> Suppliers
        {
            get
            {
                if (_suppliers == null)
                {
                    _suppliers = new List<Supplier>();
                }
                return _suppliers;
            }
            set { _suppliers = value; }
        }

        public virtual IList<FeeType> FeeTypes
        {
            get
            {
                if (_feeTypes == null)
                {
                    _feeTypes = new List<FeeType>();
                }
                return _feeTypes;
            }
            set { _feeTypes = value; }
        }

        public virtual IList<Receivables> Receivableses
        {
            get
            {
                if (_receivableses == null)
                {
                    _receivableses = new List<Receivables>();
                }
                return _receivableses;
            }
            set { _receivableses = value; }
        }

        public virtual IList<Project> Projects
        {
            get
            {
                if (_projects == null)
                {
                    _projects = new List<Project>();
                }
                return _projects;
            }
            set { _projects = value; }
        }

        public virtual IList<Purchase> Purchases
        {
            get
            {
                if (_purchases == null)
                {
                    _purchases = new List<Purchase>();
                }
                return _purchases;
            }
            set { _purchases = value; }
        }

        public virtual IList<PurchaseOrder> PurchaseOrders
        {
            get
            {
                if (_purchaseOrders == null)
                {
                    _purchaseOrders = new List<PurchaseOrder>();
                }
                return _purchaseOrders;
            }
            set { _purchaseOrders = value; }
        }

        public virtual IList<Pay> Pays
        {
            get
            {
                if (_pays == null)
                {
                    _pays = new List<Pay>();
                }
                return _pays;
            }
            set { _pays = value; }
        }

        public virtual IList<PurchaseReturn> PurchaseReturns
        {
            get
            {
                if (_purchaseReturns == null)
                {
                    _purchaseReturns = new List<PurchaseReturn>();
                }
                return _purchaseReturns;
            }
            set { _purchaseReturns = value; }
        }

        public virtual IList<Receipt> Receipts
        {
            get
            {
                if (_receipts == null)
                {
                    _receipts = new List<Receipt>();
                }
                return _receipts;
            }
            set { _receipts = value; }
        }

        public virtual IList<ReceiptCodeRule> ReceiptCodeRules
        {
            get
            {
                if (_receiptCodeRules == null)
                {
                    _receiptCodeRules = new List<ReceiptCodeRule>();
                }
                return _receiptCodeRules;
            }
            set { _receiptCodeRules = value; }
        }

        public virtual IList<Sale> Sales
        {
            get
            {
                if (_sales == null)
                {
                    _sales = new List<Sale>();
                }
                return _sales;
            }
            set { _sales = value; }
        }

        public virtual IList<SalesOrder> SalesOrders
        {
            get
            {
                if (_salesOrders == null)
                {
                    _salesOrders = new List<SalesOrder>();
                }
                return _salesOrders;
            }
            set { _salesOrders = value; }
        }

        public virtual IList<SalesReturn> SalesReturns
        {
            get
            {
                if (_salesReturns == null)
                {
                    _salesReturns = new List<SalesReturn>();
                }
                return _salesReturns;
            }
            set { _salesReturns = value; }
        }

        public virtual IList<Stock> Stocks
        {
            get
            {
                if (_stocks == null)
                {
                    _stocks = new List<Stock>();
                }
                return _stocks;
            }
            set { _stocks = value; }
        }

        public virtual IList<StockAllocate> StockAllocates
        {
            get
            {
                if (_stockAllocates == null)
                {
                    _stockAllocates = new List<StockAllocate>();
                }
                return _stockAllocates;
            }
            set { _stockAllocates = value; }
        }

        public virtual IList<StockExchange> StockExchanges
        {
            get
            {
                if (_stockExchanges == null)
                {
                    _stockExchanges = new List<StockExchange>();
                }
                return _stockExchanges;
            }
            set { _stockExchanges = value; }
        }

        public virtual IList<StockInOut> StockIns
        {
            get
            {
                if (_stockIns == null)
                {
                    _stockIns = new List<StockInOut>();
                }
                return _stockIns;
            }
            set { _stockIns = value; }
        }

        public virtual IList<StockInitialBalance> StockInitialBalances
        {
            get
            {
                if (_stockInitialBalances == null)
                {
                    _stockInitialBalances = new List<StockInitialBalance>();
                }
                return _stockInitialBalances;
            }
            set { _stockInitialBalances = value; }
        }

        public virtual IList<WareHouse> WareHouses
        {
            get
            {
                if (_wareHouses == null)
                {
                    _wareHouses = new List<WareHouse>();
                }
                return _wareHouses;
            }
            set { _wareHouses = value; }
        }



        #endregion
    }
    #endregion
}